package com.jiker.keju;

import java.io.*;

public class FileManager {

    public String readFile(String path) {
        try {
            File file = new File(path);
            return readFileEx(file);
        } catch (Exception e) {
            return null;
        }
    }

    private String readFileEx(File file) throws Exception {
        BufferedReader br = new BufferedReader(new FileReader(file));
        StringBuilder sb = new StringBuilder();
        String text;
        while((text = br.readLine()) != null){
            sb.append(text).append("\n");
        }
        br.close();
        return sb.toString();
    }
}
